import request from "@/utils/request";

/*获取角色列表*/
export  function getRoleList(current,size,roleName) {
    return request({
        url:"/role/getRoleList",
        method:'post',
        params:{
            current,
            size,
            roleName
        }
    })
}

/*根据ID删除角色*/
export function deleteRole(id){
    return request({
        url:"/role/deleteRole",
        method:'get',
        params:{
            id
        }
    })
}
/*根据ID修改角色信息*/
export function amendRole(role) {
    return request({
        url:'/role/amendRole',
        method: 'post',
        data: role
    })
}

/*添加角色*/
export function addRole(role) {
    return request({
        url:'/role/addRole',
        method:'post',
        data:role
    })
}
/*
修改角色状态
 */

export  function updateRoleStatus(role) {
    return request({
        url:'/role/updateRoleStatus',
        method:'post',
        data:role
    })
}

/*
获取角色拥有的权限
 */
export  function getRole2Menu(id) {
    return request({
        url:'/role/getRole2Menu',
        method:'get',
        params:{id}
    })
}

/*给角色授权菜单*/
export function saveMenu_Role(id,menuIdList) {
    return request({
        url:'/role/saveMenu_Role',
        method:'put',
        data:menuIdList,
        params:{
            id
        }

    })
    
}